import request from '@/utils/request'

// 添加用户
export function userAdd(data) {
  return request({
    url: '/authority/auUser/add',
    method: 'post',
    data
  })
}

// 维保人员绑定
export function userStaffBind(data) {
  return request({
    url: '/authority/auUser/staffBind',
    method: 'post',
    data
  })
}

// 查询用户列表
export function findUserList(id, name, pageIndex, pageSize) {
  return request({
    url: '/authority/auUser/queryList',
    method: 'get',
    params: { id, name, pageIndex, pageSize }
  })
}

// 查询用户详情
export function findUserDetail(id) {
  return request({
    url: '/authority/auUser/detail',
    method: 'get',
    params: { id }
  })
}

// 删除用户
export function deleteUser(id) {
  return request({
    url: '/authority/auUser/delete',
    method: 'delete',
    params: { id }
  })
}

// 修改用户
export function updateUser(data) {
  return request({
    url: '/authority/auUser/update',
    method: 'put',
    data
  })
}

// 禁用用户
export function userDisable(id) {
  return request({
    url: '/authority/auUser/disable',
    method: 'delete',
    params: { id }
  })
}

// 启用用户
export function userEnable(id) {
  return request({
    url: '/authority/auUser/enable',
    method: 'put',
    params: { id }
  })
}

// 用户注册
export function userRegister(data) {
  return request({
    url: '/authority/auUser/register',
    method: 'post',
    data
  })
}

// 用户复核
export function userReview(id) {
  return request({
    url: '/authority/auUser/review',
    method: 'put',
    params: { id }
  })
}
// 用户修改自己的密码
export function changePass(newPassword, oldPassword) {
  return request({
    url: '/authority/auUser/changepwd',
    method: 'put',
    params: { newPassword, oldPassword }
  })
}

// 绑定微信
export function changewx(wxId) {
  return request({
    url: '/authority/auUser/changewx',
    method: 'put',
    params: { wxId }
  })
}
